package top.yoahh;

import lombok.extern.slf4j.Slf4j;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.core.env.Environment;

@Slf4j
@SpringBootApplication
@MapperScan("top.yoahh.*.mapper")
public class BlogApplication {

    public static void main(String[] args) {
        ConfigurableApplicationContext run = SpringApplication.run(BlogApplication.class, args);
        Environment environment = run.getEnvironment();
        // 端口
        String port = environment.getProperty("server.port");
        // 前缀路径
        String path = environment.getProperty("server.servlet.context-path");
        log.info("----------------------------------------------");
        log.info("Application Story is running! Access URL:");
        log.info("Local:http://localhost:" + port + path);
        log.info("Swagger:http://localhost:" + port + path+"/doc.html");
        log.info("----------------------------------------------");
    }
}
